package mylibrary.hashmap;

import java.util.*;
import java.util.Map.Entry;

public class Test1 {

	public static void main(String[] args) {
		
		Map map = new HashMap();

		map.put("k1", "v1");
		map.put("k2", "v2");
		
		
		Iterator it = map.entrySet().iterator();
		while (it.hasNext()) {
			
			Map.Entry entry = (Entry) it.next();
			System.out.println(entry.getKey());
			System.out.println(entry.getValue());
		}
		
		
		Iterator i = map.keySet().iterator();
		while (i.hasNext()) {
			
			Object key = i.next();
			
			System.out.println(key);
		}
	}
}
